#include<bits/stdc++.h>

using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
int dp[maxn];
int n;

int main() {
    while (cin >> n) {
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        fill(dp, dp + n, 1);
        dp[0] = 1;
        for (int i = 1; i < n; i++) {

            for (int j = i - 1; j >= 0; j--) {
                if (a[j] >= a[i]) {
                    dp[i] = max(dp[j] + 1, dp[i]);
                }
            }

        }
        cout << *max_element(dp, dp + n) << endl;
    }
    return 0;
}